package com.yazi.mxz.mobile.common;

import javax.annotation.Resource;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.yazi.mxz.common.entity.beans.Member;
import com.yazi.mxz.common.service.MemberService;

public class BaseController extends com.yazi.mxz.common.controller.BaseController {

	@Resource
	MemberService memberService;

	public Member getMember() {
		Subject subject = SecurityUtils.getSubject();
		Long memberId = (Long) subject.getPrincipal();
		return null != memberId ? memberService.one(memberId) : null;
	}

	public Long getMemberId() {
		Subject subject = SecurityUtils.getSubject();
		return (Long) subject.getPrincipal();
	}

}
